﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMLoaiDVYTDAO
    {
        public bool m_Insert(DMLoaiDichVuYTeDTO _info)
        {
            int yt = 0;
            if (_info.BbNgungSuDung == true)
                yt = 1;
            string _sql = string.Format("usp_ThuNgan_DMLoaiDichVuYTe_Insert  N'{0}',N'{1}',{2}", _info.STenLoaiDichVuYTe, _info.STenVni, yt);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMLoaiDichVuYTeDTO _info)
        {
            int yt = 0;
            if (_info.BbNgungSuDung == true)
                yt = 1;
            string _sql = string.Format("usp_ThuNgan_DMLoaiDichVuYTe_Update {0},N'{1}',N'{2}',{3}", _info.IIDLoaiDichVuYTe, _info.STenLoaiDichVuYTe, _info.STenVni,yt);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMLoaiDichVuYTeDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMLoaiDichVuYTe_Delete {0}", _info.IIDLoaiDichVuYTe);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMLoaiDVYT()
        {
            string _sql = string.Format("usp_ThuNgan_DMLoaiDichVuYTe_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        public DataTable m_SelectTenLoaiDVYT()
        {
            string _sql = string.Format("usp_ThuNgan_DMLoaiDichVuYTe_SelectTenLoaiDVYT");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
